import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/http/bean/wroks/customers_copyInfo.dart';
import 'package:app/src/ui/app_ui.dart';
import 'package:app/src/ui/route/works/public/items/ui_base.dart';
import 'package:app/src/ui/route/works/public/items/ui_card.dart';
import 'package:app/src/utils/image_path_utils.dart';

///保底审核：申请信息
class UiGuaranteedReviewInfo {
  ///data 信息
  ///oldData 历史信息
  static Widget build(
      BuildContext context, ContractCopyInfo? data, ContractCopyInfo? oldData) {
    if (StringUtils.isEmpty(data)) {
      return AppUi.getEmptyView();
    }
    List<Widget> children = [];
    children.add(UiBase.title(
        context, AppStrings.of(context).ApplicationInfo)); //标题：申请信息
    children.add(UiBase.item(
        context,
        AppStrings.of(context).ApplicationClassName2,
        data?.ApplicationClassName,
        oldData?.ApplicationClassName)); //保底所在班组
    children.add(UiBase.item(context, AppStrings.of(context).PersonName6,
        data?.PersonName, oldData?.PersonName)); //保底申请员工
    children.add(UiBase.item(context, AppStrings.of(context).AddDate10,
        data?.AddDate, oldData?.AddDate)); //保底申请日期
    children.add(UiBase.item(context, AppStrings.of(context).OnWorkTime,
        data?.OnWorkTime, oldData?.OnWorkTime)); //班次开始时间
    children.add(UiBase.item(context, AppStrings.of(context).OffWorkTime,
        data?.OffWorkTime, oldData?.OffWorkTime)); //班次结束时间
    children.add(UiBase.itemWithEdit(
        context, AppStrings.of(context).Amount11, data?.Amount, oldData?.Amount,
        isChangeColor: false,
        isNumber: true,
        isEmpty: true,
        isNegative: false,
        isDecimal: true, onChanged: (value) {
      data?.Amount = value;
    })); //申请保底金额
    children.add(UiBase.itemWithEdit(
        context,
        AppStrings.of(context).MinWorkingHours,
        data?.MinWorkingHours,
        oldData?.MinWorkingHours,
        isChangeColor: false,
        isNumber: true,
        isEmpty: true,
        isNegative: false,
        unit: "(${AppStrings.of(context).hours})",
        isDecimal: true, onChanged: (value) {
      data?.MinWorkingHours = value;
    })); //最少工作工时
    var column = UiBase.column(context, children);
    var card = UiCard.build(context, column);
    return card;
  }
}
